﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Pegawai [dbo].[pegawai]
    /// </summary>
    public class Pegawai
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 10;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "PGW";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TableName = "[dbo].[pegawai]";
        /// <summary>
        /// Konstanta nama kolom idPegawai pada tabel
        /// </summary>
        public const string ColumnNameIdPegawai = "[id_pegawai]";
        /// <summary>
        /// Konstanta nama kolom namaPegawai pada tabel
        /// </summary>
        public const string ColumnNameNamaPegawai = "[nama_pegawai]";
        /// <summary>
        /// Konstanta nama kolom nip pada tabel
        /// </summary>
        public const string ColumnNameNip = "[NIP]";
        #endregion

        #region Fields
        /// <summary>
        /// [id_pegawai] CHAR(10) PRIMARY KEY
        /// </summary>
        private string idPegawai;
        /// <summary>
        /// [nama_pegawai] VARCHAR(50) NOT NULL
        /// </summary>
        private string namaPegawai;
        /// <summary>
        /// [NIP] CHAR(25) NOT NULL
        /// </summary>
        private string nip;
        #endregion

        #region Properties
        /// <summary>
        /// [id_pegawai] CHAR(10) NOT NULL
        /// </summary>
        public string IdPegawai
        {
            get { return this.idPegawai; }
            set { this.idPegawai = value; }
        }

        /// <summary>
        /// [nama_pegawai] VARCHAR(50) NOT NULL
        /// </summary>
        public string NamaPegawai
        {
            get { return this.namaPegawai; }
            set { this.namaPegawai = value; }
        }

        /// <summary>
        /// [NIP] CHAR(25) NOT NULL
        /// </summary>
        public string Nip
        {
            get { return this.nip; }
            set { this.nip = value; }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Pegawai()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idPegawai">[id_pegawai] CHAR(10) NOT NULL</param>
        /// <param name="namaPegawai">[nama_pegawai] VARCHAR(50) NOT NULL</param>
        /// <param name="nip">[NIP] CHAR(25) NOT NULL</param>
        public Pegawai(string idPegawai, string namaPegawai, string nip)
        {
            this.idPegawai = idPegawai;
            this.namaPegawai = namaPegawai;
            this.nip = nip;
        }
        #endregion 
        
        public override string ToString()
        {
            return string.Format("ID_PEGAWAI: {0} | NAMA_PEGAWAI: {1} | NIP: {2}",this.idPegawai, this.namaPegawai, this.nip);
        }
    }
}
